package com.bao.Servlet;

import com.bao.Service.UserService;
import com.bao.ServiceImpl.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by TangBaoshan on 2018/8/14.
 */
@WebServlet(name = "FindAgencyWXServlet")
public class FindAgencyWXServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=utf-8");
        PrintWriter out = response.getWriter();
        request.setCharacterEncoding("utf-8");
        UserService userService = new UserServiceImpl();
        String openid = request.getParameter("openid");
        int i = userService.FindCountUser(openid);
        out.print(i);
        out.flush();
        out.close();

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
